import React, { Component } from 'react'
import {Route,Redirect} from "react-router-dom"
// 登录拦截
export default class RrivateRoute extends Component {
    render() {
        // 获取信息
        let info=sessionStorage.getItem("info")
        return (
            <>
            {/* 查看信息是否存在 */}
               {info ?<Route {...this.props}></Route>:<Redirect to="/login"></Redirect>}
            </>
        )
    }
}